/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package upeu.edu.pe.controlador;
/*
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.servlet.http.HttpServletRequest;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;
import upeu.edu.pe.modelo.SauEstandar;

import upeu.edu.pe.servicio.EstandarServicio;

/**
 *
 * @author pc
 */
/*@Controller
public class EstandarController {
    @Autowired
    public EstandarServicio estandarServicio;
    Log log=LogFactory.getLog(EstandarController.class);
    
    @RequestMapping(value="reporte", method= RequestMethod.GET)
    public ModelAndView irReporte(){
        List<SauEstandar> lista=estandarServicio.listaEstandar();
        
        Map<String, Object> modelo=new HashMap<String, Object>();
        modelo.put("listEstandar", lista);
        modelo.put("msg", "Reporte de Estandares");
        return new ModelAndView("modulos/estandar/mainEstandar", modelo);
        
    }
    
    @RequestMapping(value="estandarGuardar", method= RequestMethod.POST)
    public ModelAndView gusrdarEstandar(@ModelAttribute("ModeloEstandar") SauEstandar estandar,BindingResult result){
        estandarServicio.insertarEstandar(estandar);
        return new ModelAndView("index");
    }
    
    @RequestMapping(value="formEstandar", method= RequestMethod.GET)
    public ModelAndView irFormulario(@ModelAttribute("ModeloEstandar") SauEstandar estandar, BindingResult result){
        return new ModelAndView("modulos/estandar/formEstandar");
    }
    
    @RequestMapping(value="eliminarEst", method= RequestMethod.GET)
    public ModelAndView eliminarEstandar(HttpServletRequest request){
        String idEstandar =request.getParameter("idEstandarE")==null?"":request.getParameter("idEstandarE");
        estandarServicio.eliminarEstandar(idEstandar);
        return new ModelAndView("redirect:reporte.html");
    }
    
    @RequestMapping(value="editarEstandar", method= RequestMethod.GET)
    public ModelAndView editarEstandarForm(HttpServletRequest request){
//        String idEstandar=String.valueOf(idEstandar);
    String idEstandar=request.getParameter("idEstandarE")==null?"":request.getParameter("idEstandarE");
    SauEstandar estandarTO=null;
    int idStandardd=Integer.parseInt(idEstandar);
    estandarTO=estandarServicio.buscarEstandarId(idStandardd);
    return new ModelAndView("modulos/estandar/formEditEstandar","ActualizarModelo",estandarTO);
    }
    
    @RequestMapping(value="actualizarEstandar", method= RequestMethod.POST)
    public ModelAndView actualizarEstandar(@ModelAttribute("ActualizarModelo") SauEstandar estandar, BindingResult result){
    SimpleDateFormat format = new SimpleDateFormat("dd/mm/yyyy");
       String fechaRecepcionada=String.valueOf(estandar.getFecha());
       System.out.println(fechaRecepcionada);
        try {
            estandar.setFecha(format.parse(fechaRecepcionada));
        } catch (ParseException ex) {
            Logger.getLogger(EstandarController.class.getName()).log(Level.SEVERE, null, ex);
           
        }
        estandarServicio.actualizarEstandar(estandar);
        return new ModelAndView("redirect:reporte.html");
    }
    
}
*/